from django.apps import AppConfig
from django.contrib.auth.models import Permission
from.models import FollowPrice
from.permissions import FOLLOWPRICE_ACCESS_PERMISSION, FOLLOWPRICE_MODIFY_PERMISSION
class AppConfig(AppConfig):
    name = 'app'
    def ready(self):
        content_type = ContentType.objects.get_for_model(FollowPrice)
        Permission.objects.get_or_create(codename=FOLLOWPRICE_ACCESS_PERMISSION, content_type=content_type, name='Can access followprice')
        Permission.objects.get_or_create(codename=FOLLOWPRICE_MODIFY_PERMISSION, content_type=content_type, name='Can modify followprice')